package top.jybill.converter;

import org.springframework.core.convert.converter.Converter;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

public class String2TimeStampConverter implements Converter<String, Timestamp> {
  public Timestamp convert(String source) {
    System.out.println(source);
    return null;
    // ... 转换
   /* SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    try {
      System.out.println(source);
      System.out.println(sdf.parse(source).getTime());
      return new Timestamp(sdf.parse(source).getTime());
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;*/
  }
}  

